package com.qitmiaojie.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName material
 */
@TableName(value ="material")
@Data
public class Material implements Serializable {
    /**
     * 物资的主键
     */
    @TableId(type = IdType.AUTO)
    private Integer mid;

    /**
     * 物资的库存
     */
    private Integer mstock;

    /**
     * 物资标题
     */
    private String mtitle;

    /**
     * 物资的描述
     */
    private String mdescription;

    /**
     * 物资的图片
     */
    private String mimg;


    /**
     * 物资的生成时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date mcreatetime;

    /**
     * 物资的更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date mupdatetime;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Material other = (Material) that;
        return (this.getMid() == null ? other.getMid() == null : this.getMid().equals(other.getMid()))
            && (this.getMstock() == null ? other.getMstock() == null : this.getMstock().equals(other.getMstock()))
            && (this.getMcreatetime() == null ? other.getMcreatetime() == null : this.getMcreatetime().equals(other.getMcreatetime()))
            && (this.getMupdatetime() == null ? other.getMupdatetime() == null : this.getMupdatetime().equals(other.getMupdatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMid() == null) ? 0 : getMid().hashCode());
        result = prime * result + ((getMstock() == null) ? 0 : getMstock().hashCode());
        result = prime * result + ((getMcreatetime() == null) ? 0 : getMcreatetime().hashCode());
        result = prime * result + ((getMupdatetime() == null) ? 0 : getMupdatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", mid=").append(mid);
        sb.append(", mstock=").append(mstock);
        sb.append(", mcreatetime=").append(mcreatetime);
        sb.append(", mupdatetime=").append(mupdatetime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}